package com.hisense.ovcloud.mqtt.warehouse.dao;

import com.hisense.ovcloud.mqtt.warehouse.entity.device.ProductInfo;
import org.springframework.stereotype.Component;

@Component
public class ProductDao {
    public ProductInfo findProductInfo(String domainId, String subDomainId) {
        return ProductInfo.model()
                .where(ProductInfo::getDomain).eq(domainId)
                .where(ProductInfo::getSubDomainId).eq(subDomainId)
                .one();
    }

    public ProductInfo findProductInfoByFeatureCode(String featureCode) {
        return ProductInfo.model()
                .where(ProductInfo::getFeaturecode).eq(featureCode)
                .one();
    }
}
